<?php

require_once dirname(__FILE__) . '/TestCase.php';
require_once 'Auth/Vidoop/Secure/ImageShieldService.php';

class Auth_Vidoop_Secure_ImageShieldParseTest extends Auth_Vidoop_Secure_TestCase {

	public function testResponseParsing() {
		$xml = file_get_contents($this->data_dir . 'imageshield_response_1.xml');
		$shield = Auth_Vidoop_ImageShield::from_xml($xml);

		$this->assertEquals('abc123', $shield->id);
		$this->assertEquals(2, $shield->imageshield_length);
		$this->assertFalse($shield->order_matters);
		$this->assertEquals(4, $shield->width);
		$this->assertEquals(3, $shield->height);
		$this->assertEquals('Red', $shield->image_code_color);
		$this->assertEquals('https://api.vidoop.com/vs/imageshields/abc123/image', $shield->image);
		$this->assertFalse($shield->attempted);
		$this->assertFalse($shield->authenticated);
	}

}
